<!DOCTYPE html>
<html>
<head>
  <script src="../../processing.js"></script>
<link rel="stylesheet" href="../style.css"/></head>
<body><h1><a href="http://ejohn.org/blog/processingjs/">Processing.js</a></h1>
<h2>MouseOver and MouseOut</h2>

<p>Mouse over the sketch, then mouse out. The background color should change for each.</p>

<p>Processing.js only<br>
<script type="application/processing">
// Issue 670 

// Mouse over the window. Then move the mouse out.
// Does the background change color?

void setup() {
  size(200,200);
  background(10);
}

void draw() {}

void mouseOut() {
  background(140,50,80);
}

void mouseOver() {
  background(50,80,140);
}
</script><canvas width="200" height="200"></canvas></p>
<div style="height:0px;width:0px;overflow:hidden;"></div>

<pre><b>// written by Chris Lonnen</b>
// Issue 670 

// Mouse over the window. Then move the mouse out.
// Does the background change color?

void setup() {
  size(200,200);
  background(10);
}

void draw() {}

void mouseOut() {
  background(140,50,80);
}

void mouseOver() {
  background(50,80,140);
}</pre>
</body>
</html>
